package com.zsrt.highschool.entity;

import java.io.Serializable;

/**
 * 考生类
 * @author Administrator
 *
 */
public class Examinee implements Serializable{
	private static final long serialVersionUID = 1L;
	/**
	 * 姓名
	 */
	private String name;
	/**
	 * 准考证号
	 */
	private String ticketId;
	/**
	 * 密码
	 */
	private String password;
	/**
	 * 年龄
	 */
	private int age;
	/**
	 * 省份
	 */
	private String province;
	/**
	 * 城市
	 */
	private String city;
	/**
	 * 语文成绩
	 */
	private int chineseScore;
	/**
	 * 数学成绩
	 */
	private int mathScore;
	/**
	 * 英语成绩
	 */
	private int englishScore;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setTicketId(String ticketId) {
		this.ticketId = ticketId;
	}
	public String getTicketId() {
		return ticketId;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public int getChineseScore() {
		return chineseScore;
	}
	public void setChineseScore(int chineseScore) {
		this.chineseScore = chineseScore;
	}
	public int getMathScore() {
		return mathScore;
	}
	public void setMathScore(int mathScore) {
		this.mathScore = mathScore;
	}
	public int getEnglishScore() {
		return englishScore;
	}
	public void setEnglishScore(int englishScore) {
		this.englishScore = englishScore;
	}
	
	/**
	 * 学生登录
	 * @param ticketId
	 * @param password
	 * @return
	 */
	public boolean login(String ticketId, String password){
		return this.ticketId.equals(ticketId) && this.password.equals(password);
	}
	
	/**
	 * 计算总分
	 * @return 数学 语文 和英语的成绩和
	 */
	public int getTotalScore(){
		return this.chineseScore+this.englishScore+this.mathScore;
	}
	/**
	 * 重写equals方法
	 */
	public boolean equals(Object obj){
		if(this==obj){
			return true;
		}
		if(obj==null){
			return false;
		}
		if(!(obj instanceof Examinee)){
			return false;
		}
		return this.ticketId.equals(((Examinee)obj).ticketId);
	}
	@Override
	public String toString() {
		return ticketId+"\t"+name+"\t"+age+"\t"+province+"\t"+city+"\t"+chineseScore+"\t"+mathScore+"\t"+englishScore+"\t"+getTotalScore()+"\n";
	}
	
	
	
	
	

}
